<?php

namespace App\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class CronProcessingEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $event_name;
    public $relate_id;


    /**
     * 执行事件
     * @param $event_name
     * @param $relate_id
     */
    public function __construct($event_name,$relate_id)
    {

        $this->event_name = $event_name;
        $this->relate_id = $relate_id;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
